package com.qf.push.quartzjob.job;

import com.qf.base.utils.SpringContestUtil;
import com.qf.push.dao.IdemDao;
import com.qf.push.model.IdemExample;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;

/**
 * @author 30909
 */
public class IdemDelJob implements Job {

    @Override
    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {

    }

    private IdemDao idemDao;

    public void delIemData() {
        if (idemDao == null) {
            idemDao = SpringContestUtil.getBean(IdemDao.class);
        }
        IdemExample idemExample = new IdemExample();

        IdemExample.Criteria criteria = idemExample.createCriteria();
        //半小时
        long time = System.currentTimeMillis() - 1000 * 60 * 3;
        criteria.andTimeLessThan(time);
        idemDao.deleteByExample(idemExample);
    }
}
